<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/components/MMS/Admin/Home/Content.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\..\index.html">All files</a> / <a href="index.html">src/components/MMS/Admin/Home</a> Content.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/29</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/12</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/14</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/29</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div class="content"&gt;
    &lt;div class="window"&gt;
      &lt;el-tabs type="border-card" v-model="octopus.passport.tabCurrentName"
               @tab-click="set" closable @tab-remove="removeTab"&gt;
        &lt;el-tab-pane name="M_0"&gt;
          &lt;span slot="label"&gt;&lt;div class="glyphicon glyphicon-home"&gt;&lt;/div&gt;&lt;/span&gt;
          &lt;iframe v-bind:src="get(octopus.passport.tab[0].url)"&gt;&lt;/iframe&gt;
        &lt;/el-tab-pane&gt;
        &lt;el-tab-pane v-for="tab in octopus.passport.tab" :name="'M_'+tab.id" :key="tab.id" v-if="tab.id&gt;-1"&gt;
          &lt;span slot="label"&gt;
            {{tab.name}}&lt;/span&gt;
          &lt;iframe v-bind:src="get(tab.url)"&gt;&lt;/iframe&gt;
        &lt;/el-tab-pane&gt;
      &lt;/el-tabs&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
  export default {
    name: 'com_content', /* 这个name暂时不知道用啥用，根据官方文档说的是方便排错的 */
<span class="fstat-no" title="function not covered" >    data() {</span>
<span class="cstat-no" title="statement not covered" >      return {</span>
        octopus: this.$parent.octopus,
        // height: 50,// 默认高度
        // width: 100, // 默认宽度
      }
    },
<span class="fstat-no" title="function not covered" >    created: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.init();</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Content.vue执行了created事件，路由模式：" + this.$router.mode + "，路由模式2：" + this.octopus.router.getter().mode);</span>
    },
<span class="fstat-no" title="function not covered" >    updated: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Content.vue执行了updated事件。");</span>
    },
<span class="fstat-no" title="function not covered" >    mounted: function () {</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >      this.$nextTick(function () {</span></span>
        // 主页是不能删除的。
<span class="cstat-no" title="statement not covered" >        $("#tab-M_0 .el-icon-close").hide();</span>
      });
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Content.vue执行了mounted事件。");</span>
    },
    // 活动事件，写在这里的好处是不管是第一次创建还是后退回来，都会触发这个事件
    // 比较典型的就是列表组件，返回的时候往往是需要刷新的。
<span class="fstat-no" title="function not covered" >    activated: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.load();</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Content.vue执行了activated事件。");</span>
    },
    computed: {},
    methods: {
      // 初始化
<span class="fstat-no" title="function not covered" >      init: function () {</span>
<span class="cstat-no" title="statement not covered" >        this.initData();</span>
      },
      // 初始化相关内容
<span class="fstat-no" title="function not covered" >      initData: function () {</span>
<span class="cstat-no" title="statement not covered" >        let o = this;</span>
        // $(window).resize(function () {
        //   o.resize();
        // });
        // // 5秒后补刀一下。
        // setTimeout(function () {
        //   o.resize();
        // }, 5000);
      },
      // iframe onload complete event。
<span class="fstat-no" title="function not covered" >      load: function () {</span>
        // this.resize();
      },
      // // 内容控件联动事件，由外部触发。
      // resize: function () {
      //   let o = this;
      //   $(document).ready(function () {
      //     o.height = $(window).height() - o.octopus.template.getTheme().offset.content;
      //     let windowWidth = $(window).width();
      //     windowWidth = windowWidth &gt; 1000 ? windowWidth : 1000;// 因为框架设置了最小为1000，所以过小就不缩了。
      //     o.width = windowWidth - 200;// 菜单默认给予200宽度
      //   });
      // },
      // 获取
<span class="fstat-no" title="function not covered" >      get: function (url) {</span>
<span class="cstat-no" title="statement not covered" >        if (!this.octopus.tools.IsNullOrEmpty(url)) {</span>
          // 判断路由模式，如果是hash，则需要加上#/
<span class="cstat-no" title="statement not covered" >          if (this.octopus.router.getter().mode == "hash" &amp;&amp; url.indexOf("http") == -1) {</span>
<span class="cstat-no" title="statement not covered" >            url = "#" + url;</span>
          }
          // 不存于护照，每次动态追加Token，时刻保持新鲜。
<span class="cstat-no" title="statement not covered" >          url = url.indexOf("?") &gt; 0 ? url + "&amp;" : url + "?";</span>
<span class="cstat-no" title="statement not covered" >          url = url + "access_token=" + this.octopus.passport.token;</span>
<span class="cstat-no" title="statement not covered" >          return url;</span>
        } else {
<span class="cstat-no" title="statement not covered" >          return "../NoData";</span>
        }
      },
<span class="fstat-no" title="function not covered" >      set: function (tab, event) {</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.passport.tabCurrentName = tab.name;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >        let clickTab = null;</span>
        // 回调tab的click事件
<span class="cstat-no" title="statement not covered" >        if (this.click) {</span>
<span class="cstat-no" title="statement not covered" >          if (tab.name != "M_0") {</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >            clickTab = $.grep(this.octopus.passport.tab, function (curr, i) {</span></span>
<span class="cstat-no" title="statement not covered" >              return curr.id.toString() == tab.name.split("_")[1];</span>
            })[0];
          } else {
<span class="cstat-no" title="statement not covered" >            clickTab = this.octopus.passport.tab[0];</span>
          }
<span class="cstat-no" title="statement not covered" >          this.click(clickTab);</span>
        }
      },
<span class="fstat-no" title="function not covered" >      removeTab: function (name) {</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.passport.tabCurrentName = "M_0";</span>
        // 移除
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >        this.octopus.passport.tab = $.grep(this.octopus.passport.tab, function (curr, i) {</span></span>
<span class="cstat-no" title="statement not covered" >          return curr.id.toString() != name.split("_")[1];</span>
        });
      }
&nbsp;
    }
    ,
    watch: {
      // // 监听source对象
      // 'octopus.passport.tab': {
      //   handler(newval, oldval) {
      //     this.getCurrentTab();
      //   },
      //   deep: true // 启用深度监听模式，可监控到属性。
      // }
    }
    ,
    props: ["click"]
  }
&lt;/script&gt;
&nbsp;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>
